package com.meeting.order.mapper;

import com.meeting.order.domain.MeetingRoom;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MeetingRoomMapper {
    // 查询所有会议室信息
    @Select("SELECT room_id as roomId, room_name as roomName, facilities, is_active as isActive FROM room")
    List<MeetingRoom> findAllMeetingRooms();

    // 根据会议室ID查询会议室信息
    @Select("SELECT room_id as roomId, room_name as roomName, facilities, is_active as isActive FROM room WHERE room_id = #{roomId}")
    MeetingRoom findMeetingRoomById(@Param("roomId") String roomId);

    // 根据会议室名称查询会议室信息
    @Select("SELECT room_id as roomId, room_name as roomName, facilities, is_active as isActive FROM room WHERE room_name = #{roomName}")
    MeetingRoom findMeetingRoomByName(@Param("roomName") String roomName);
}